//判断链表是否带环
//给你一个链表的头节点 head ，判断链表中是否有环。
//思路：快慢双指针
bool hasCycle(struct ListNode* head) {
	if (!head || !(head->next))
		return false;
	struct ListNode* fast = head->next;
	struct ListNode* slow = head;
	//最多走一圈
	while (fast != slow) {
		if (!fast || !(fast->next))
			return false;
		fast = fast->next->next;
		slow = slow->next;

	}
	return true;

}